<?php

namespace App\Http\Controllers\Api\V1\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class DivinationCategoriesResource extends JsonResource
{
    public function toArray($request)
    {
        $resource = $this->resource;
        
       
        return [
            'id' => (int)$resource->id,
            'name'=>$resource->category->name ?? '',
            'category_id'=>$resource->category->id,
            'created_at' => (string)$resource->created_at,
        ];
    }
}
